home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1993-11-04 | 28.3 KB | 896 lines |
- (***********************************************************************
-
- :Program. PlotZeichnen.mod
- :Author. Stefan Köhle
- :Address. Erhardtstr. 10
- W-7033 Herrenberg
- :Phone. 07032/5146
- :shortcut.
- :Version. 1.0
- :Date. 23.11.92
- :Copyright. nix
- :Language. Modula-II.
- :Translator. M2Amiga 4.107d
- :Imports. Plotinit, MyMathLib
- :UpDate.
- :Contents.
- :Remark.
-
- **********************************************************************)
-
- IMPLEMENTATION MODULE PlotZeichnen;
-
-
- FROM PlotInit IMPORT PlotBasePtr,WelcheTaste ;
- FROM MyMathLib IMPORT IntToReal,RealToInt,IntToFFP,FFPToInt,FFPToStr ;
-
- FROM SYSTEM IMPORT BITSET,ADR,ADDRESS,FFP,LONGSET ;
- FROM GraphicsL IMPORT AreaMove,AreaDraw,AreaEnd,Text,
- SetAPen,SetDrMd,RectFill,Move,Draw ;
- FROM String IMPORT Length,CopyPart;
- IMPORT GfxMacros ;
- IMPORT GraphicsD ;
- IMPORT GraphicsL ;
- IMPORT IntuitionD ;
- IMPORT IntuitionL ;
- IMPORT ExecL ;
-
- CONST BitMapWidth = 1720 ;
- BitMapHeight = 1351 ;
-
-
-
-
- PROCEDURE RasterZeichnen(VAR Pb: PlotBasePtr) ; (************************)
-
- VAR j: INTEGER ;
-
- BEGIN
-
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
-
- IF Pb^.GrosseBitmap THEN
- FOR j := 1 TO 11 DO (* links senkrecht *)
- IF (Pb^.Achsen AND (j*36-432 = -Pb^.A.YNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
- Move(Pb^.Rp,Pb^.KastenX0-432+j*36,Pb^.KastenY0+432-j*36) ;
- Draw(Pb^.Rp,Pb^.KastenX0-432+j*36,Pb^.KastenY0+1152-j*36) ;
- END (* FOR *) ;
-
- FOR j := 1 TO 15 DO (* hinten senkrecht *)
- IF (Pb^.Achsen AND (j*72 = Pb^.A.XNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
- Move(Pb^.Rp,Pb^.KastenX0+j*72,Pb^.KastenY0);
- Draw(Pb^.Rp,Pb^.KastenX0+j*72,Pb^.KastenY0+720);
- END (* FOR *) ;
-
- FOR j := 1 TO 15 DO (* waagrecht *)
- IF (Pb^.Achsen AND (j*45 = Pb^.A.ZNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- Move(Pb^.Rp,Pb^.KastenX0-432,Pb^.KastenY0+432+j*45) ;
- Draw(Pb^.Rp,Pb^.KastenX0,Pb^.KastenY0+j*45) ;
- Draw(Pb^.Rp,Pb^.KastenX0+800,Pb^.KastenY0+j*45) ;
- Draw(Pb^.Rp,Pb^.KastenX0+1152,Pb^.KastenY0+j*45) ;
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0AAAAH) ; (* fein gestrichelt *)
- Move(Pb^.Rp,Pb^.KastenX0-432,Pb^.KastenY0+432+j*45) ;
- Draw(Pb^.Rp,Pb^.KastenX0,Pb^.KastenY0+j*45) ;
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- Draw(Pb^.Rp,Pb^.KastenX0+800,Pb^.KastenY0+j*45) ;
- Draw(Pb^.Rp,Pb^.KastenX0+1152,Pb^.KastenY0+j*45) ;
- END ;
- END (* FOR *) ;
- ELSE
-
- FOR j := 0 TO 6 DO (* hinten senkrecht *)
-
- IF (Pb^.Achsen AND (j*48+48 = Pb^.A.XNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
-
- Move(Pb^.Rp,Pb^.KastenX0+48+j*48,Pb^.KastenY0);
- Draw(Pb^.Rp,Pb^.KastenX0+48+j*48,Pb^.KastenY0+240) ;
- END (* FOR *) ;
-
- FOR j := 0 TO 6 DO (* hinten u. links waagrecht *)
-
- IF (Pb^.Achsen AND (30+j*30 = Pb^.A.ZNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- Move(Pb^.Rp,Pb^.KastenX0-144,Pb^.KastenY0+174+j*30);
- Draw(Pb^.Rp,Pb^.KastenX0,Pb^.KastenY0+30+j*30) ;
- Draw(Pb^.Rp,Pb^.KastenX0+384,Pb^.KastenY0+30+j*30) ;
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0AAAAH) ; (* fein gestrichelt *)
- Move(Pb^.Rp,Pb^.KastenX0-144,Pb^.KastenY0+174+j*30);
- Draw(Pb^.Rp,Pb^.KastenX0,Pb^.KastenY0+30+j*30) ;
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- Draw(Pb^.Rp,Pb^.KastenX0+384,Pb^.KastenY0+30+j*30) ;
- END ;
- END (* FOR *) ;
-
-
- FOR j := 0 TO 4 DO (* links senkrecht *)
-
- IF (Pb^.Achsen AND (j*24-120 = -Pb^.A.YNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
- Move(Pb^.Rp,Pb^.KastenX0-120+j*24,Pb^.KastenY0+120-j*24);
- Draw(Pb^.Rp,Pb^.KastenX0-120+j*24,Pb^.KastenY0+360-j*24) ;
- END (* FOR *) ;
- END (* IF *) ;
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ;
-
- END RasterZeichnen ;
-
-
-
- PROCEDURE RestRaster(VAR Pb: PlotBasePtr) ; (*****************************)
-
- VAR x,y,x1,y1,xLinks,xRechts,xGanzRechts,yGanzRechts,yUnten,
- step,Schnittpunkt,YWertmin,P1x,RasterStep: INTEGER ;
- X1,X2,Y1,Y2,j: INTEGER ;
- OK: BOOLEAN ;
-
- BEGIN
-
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
-
- IF Pb^.GrosseBitmap THEN
- P1x := 432 ; RasterStep := 45 ;
- xLinks := Pb^.KastenX0-432 ; xRechts := Pb^.KastenX0+720 ;
- yUnten := Pb^.KastenY0+1152; step := 18 ; YWertmin := Pb^.KastenY0+720 ;
- xGanzRechts := Pb^.KastenX0+1152 ; yGanzRechts := Pb^.KastenY0+720 ;
- ELSE
- P1x := 144 ; RasterStep := 30 ;
- xLinks := Pb^.KastenX0-144 ; xRechts := Pb^.KastenX0+240 ;
- yUnten := Pb^.KastenY0+384 ; step := 12 ; YWertmin := Pb^.KastenY0+240 ;
- xGanzRechts := Pb^.KastenX0+384 ; yGanzRechts := Pb^.KastenY0+240 ;
- END ;
-
- IF Pb^.Flaeche THEN
- y := Pb^.ymax ;
- x := Pb^.Schritt ;
-
- WHILE x <= Pb^.xmax DO (* vorne rum *)
- SetAPen(Pb^.Rp,0) ; (* Hintergrundfarbe *)
-
- OK := AreaMove(Pb^.Rp,Pb^.Wert[x-Pb^.Schritt,y].XWert+1,yUnten-1);
-
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x,y].XWert,yUnten-1) ;
-
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x,y].XWert,Pb^.Wert[x,y].YWert);
-
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x-Pb^.Schritt,y].XWert+1,
- Pb^.Wert[x-Pb^.Schritt,y].YWert) ;
-
- OK := AreaEnd(Pb^.Rp) ;
-
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
-
-
- Move(Pb^.Rp,Pb^.Wert[x-Pb^.Schritt,y].XWert,
- Pb^.Wert[x-Pb^.Schritt,y].YWert);
- Draw(Pb^.Rp,Pb^.Wert[x,y].XWert,
- Pb^.Wert[x,y].YWert) ;
- x := x+Pb^.Schritt ;
- END (* WHILE *) ;
-
-
- x := Pb^.xmax ;
- y := Pb^.Schritt ;
-
- WHILE y <= Pb^.ymax DO (* rechts rum *)
- SetAPen(Pb^.Rp,0) ;
- OK := AreaMove(Pb^.Rp,Pb^.Wert[x,y-Pb^.Schritt].XWert-1,
- YWertmin+2*(y-Pb^.Schritt)) ;
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x,y-Pb^.Schritt].XWert-1,
- Pb^.Wert[x,y-Pb^.Schritt].YWert);
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x,y].XWert,
- Pb^.Wert[x,y].YWert) ;
- OK := AreaDraw(Pb^.Rp,Pb^.Wert[x,y].XWert,
- YWertmin+2*y) ;
- OK := AreaEnd(Pb^.Rp) ;
- SetAPen(Pb^.Rp,1) ;
-
- Move(Pb^.Rp,Pb^.Wert[x,y].XWert,Pb^.Wert[x,y].YWert);
- Draw(Pb^.Rp,Pb^.Wert[x,y-Pb^.Schritt].XWert,
- Pb^.Wert[x,y-Pb^.Schritt].YWert);
- Move(Pb^.Rp,Pb^.Wert[x,y-Pb^.Schritt].XWert,
- YWertmin+2*(y-Pb^.Schritt)) ;
- Draw(Pb^.Rp,Pb^.Wert[x,y].XWert,YWertmin+2*y) ;
-
- y := y+Pb^.Schritt ;
- END (* WHILE *) ;
-
- END (* IF Flaeche *) ;
-
- Move(Pb^.Rp,xRechts,yUnten) ; (* senkrechte Linie rechts unten *)
- Draw(Pb^.Rp,xRechts,Pb^.Wert[Pb^.xmax,Pb^.ymax].YWert) ;
-
-
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
-
-
- j := step ;
- WHILE j <= Pb^.xmax DO (* vorne senkrecht *)
-
- IF (Pb^.Achsen AND (xLinks+4*j = Pb^.KastenX0-P1x+Pb^.A.XNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
- Move(Pb^.Rp,xLinks+4*j,yUnten) ;
- Draw(Pb^.Rp,xLinks+4*j,Pb^.Wert[j,Pb^.ymax].YWert) ;
- j := j+step ;
- END ;
-
-
- j := step ;
- WHILE j <= Pb^.ymax DO
- IF (Pb^.Achsen AND (yGanzRechts+2*j = Pb^.A.YNull+YWertmin)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
- Move(Pb^.Rp,xGanzRechts-2*j,yGanzRechts+2*j) ; (* rechts senkrecht *)
- Draw(Pb^.Rp,xGanzRechts-2*j,Pb^.Wert[Pb^.xmax,j].YWert) ;
- j := j+step ;
- END ;
-
-
- y1 := yUnten ;
-
- WHILE y1 >= Pb^.KastenY0 DO (* vorne waagrecht *)
-
- y1 := y1-RasterStep ;
- Move(Pb^.Rp,xLinks,y1) ;
-
- IF (Pb^.Achsen AND (y1 = Pb^.KastenY0+Pb^.A.ZNull+P1x)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0CCCCH) ; (* gestrichelt *)
- END ;
-
- x := 0 ;
- WHILE x <= Pb^.xmax DO
-
-
- IF Pb^.Wert[x,Pb^.ymax].YWert <= y1 THEN (* Funktion drueber *)
-
- Draw(Pb^.Rp,xLinks+4*x,y1) ;
- IF Pb^.Wert[x+Pb^.Schritt,Pb^.ymax].YWert > y1 THEN
- (* Wechsel nach unten *)
-
- Schnittpunkt := xLinks+4*x+(y1-Pb^.Wert[x,Pb^.ymax].YWert)*
- 4*Pb^.Schritt/(Pb^.Wert[x+Pb^.Schritt,
- Pb^.ymax].YWert-Pb^.Wert[x,Pb^.ymax].YWert);
-
- Draw(Pb^.Rp,Schnittpunkt,y1) ;
-
- ELSE (* immer noch drueber *)
-
- Draw(Pb^.Rp,xLinks+4*x,y1) ;
-
- END ;
-
- ELSE (* Funktion drunter *)
-
- Move(Pb^.Rp,xLinks+4*x,y1) ;
-
- IF Pb^.Wert[x+Pb^.Schritt,Pb^.ymax].YWert <= y1 THEN
- (* Wechsel nach oben *)
- Schnittpunkt := xLinks+4*x+(y1-Pb^.Wert[x,Pb^.ymax].YWert)*
- 4*Pb^.Schritt/(Pb^.Wert[x+Pb^.Schritt,
- Pb^.ymax].YWert-Pb^.Wert[x,Pb^.ymax].YWert);
-
- Move(Pb^.Rp,Schnittpunkt,y1) ;
-
- ELSE (* immer noch drunter *)
- Move(Pb^.Rp,xLinks+4*x,y1) ;
- END ;
-
- END ; x := x+Pb^.Schritt ;
-
- END (* WHILE *) ;
-
- END (* WHILE y1 *) ;
-
- (* vorne rechts *)
-
- y1 := yUnten ;
-
- WHILE y1 >= Pb^.KastenY0+P1x+RasterStep DO
- y1 := y1 - RasterStep ;
-
- Move(Pb^.Rp,xRechts,y1) ;
-
- IF (Pb^.Achsen AND (y1 = Pb^.KastenY0+yUnten-YWertmin+Pb^.A.ZNull)) THEN
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
- ELSE
- GfxMacros.SetDrPt(Pb^.Rp,0AAAAH) ; (* fein gestrichelt *)
- END ;
-
- y := Pb^.ymax ; x := Pb^.xmax ;
- WHILE y > 0 DO
-
- X1 := xRechts+2*(Pb^.ymax-y) ;
- X2 := xRechts+2*(Pb^.ymax-(y-Pb^.Schritt)) ;
- Y1 := Pb^.Wert[Pb^.xmax,y].YWert+2*(Pb^.ymax-y) ;
- Y2 := Pb^.Wert[Pb^.xmax,y-Pb^.Schritt].YWert
- + 2*(Pb^.ymax-(y-Pb^.Schritt)) ;
-
- (*Funktion drueber *)
- IF Pb^.Wert[x,y].YWert <= y1-2*(Pb^.ymax-y) THEN
-
-
- IF Pb^.Wert[x,y-Pb^.Schritt].YWert > (* Wechsel nach unten *)
- y1-2*(Pb^.ymax-y)-2*Pb^.Schritt THEN
-
- Schnittpunkt := X1+(y1-Y1)*(X2-X1)/(Y2-Y1) ;
-
- Draw(Pb^.Rp,Schnittpunkt,y1+xRechts-Schnittpunkt) ;
-
-
- ELSE (* immer noch drueber *)
-
- Draw(Pb^.Rp,xRechts+2*Pb^.Schritt+2*(Pb^.ymax-y),
- y1-2*Pb^.Schritt-2*(Pb^.ymax-y)) ;
-
- END ;
-
- ELSE (* Funktion drunter *)
-
- IF Pb^.Wert[x,y-Pb^.Schritt].YWert <
- y1-2*(Pb^.ymax-y)-2*Pb^.Schritt THEN
- (* Wechsel nach oben *)
- Schnittpunkt := X1+(y1-Y1)*(X2-X1)/(Y2-Y1) ;
- Move(Pb^.Rp,Schnittpunkt,y1+xRechts-Schnittpunkt) ;
-
- ELSE (* immer noch drunter *)
- Move(Pb^.Rp,xRechts+2*Pb^.Schritt+2*(Pb^.ymax-y),
- y1-2*Pb^.Schritt-2*(Pb^.ymax-y)) ;
-
- END ;
-
- END ;
-
- y := y-Pb^.Schritt ;
-
- END (* WHILE *) ;
-
- END (* WHILE y1 *) ;
-
- GfxMacros.SetDrPt(Pb^.Rp,0FFFFH) ; (* durchgezogen *)
-
- END RestRaster ;
-
-
-
- PROCEDURE BeschriftungZeichnen(VAR Pb: PlotBasePtr) ; (*******************)
-
- VAR j: INTEGER ;
- l: FFP ;
- str : ARRAY[0..10] OF CHAR ;
-
- BEGIN
-
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
-
- IF NOT Pb^.GrosseBitmap THEN
-
-
- FOR j := 0 TO 4 DO (* grosse Knubbel x-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0-144+j*96,Pb^.KastenY0+384) ;
- Draw(Pb^.Rp,Pb^.KastenX0-144+j*96,Pb^.KastenY0+384+6) ;
- END (* FOR *) ;
- FOR j := 0 TO 3 DO (* kleine Knubbel x-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0-96+j*96,Pb^.KastenY0+384) ;
- Draw(Pb^.Rp,Pb^.KastenX0-96+j*96,Pb^.KastenY0+384+3) ;
- END (* FOR *) ;
-
-
- FOR j := 0 TO 3 DO (* grosse Knubbel y-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+384-j*48,Pb^.KastenY0+240+j*48) ;
- Draw(Pb^.Rp,Pb^.KastenX0+384+6-j*48,Pb^.KastenY0+240+j*48) ;
- END (* FOR *) ;
-
- FOR j := 0 TO 2 DO (* kleine Knubbel y-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+360-j*48,Pb^.KastenY0+240+24+j*48) ;
- Draw(Pb^.Rp,Pb^.KastenX0+360+3-j*48,Pb^.KastenY0+240+24+j*48) ;
- END (* FOR *) ;
-
-
- FOR j := 0 TO 8 BY 2 DO (* grosse Knubbel z-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+384,Pb^.KastenY0+j*30) ;
- Draw(Pb^.Rp,Pb^.KastenX0+384+6,Pb^.KastenY0+j*30) ;
- END ;
-
- FOR j := 1 TO 7 BY 2 DO (* kleine Knubbel z-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+384,Pb^.KastenY0+j*30) ;
- Draw(Pb^.Rp,Pb^.KastenX0+384+3,Pb^.KastenY0+j*30) ;
- END ;
-
- l := Pb^.B.XLinks ; (* Text x-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0-150,Pb^.KastenY0+408+5) ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 1 TO 4 DO
- l := Pb^.B.XLinks+ IntToFFP(j)*Pb^.B.DeltaX ;
- Move(Pb^.Rp,Pb^.KastenX0-170+j*96,Pb^.KastenY0+408+5) ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
-
- Move(Pb^.Rp,Pb^.KastenX0+404,Pb^.KastenY0+251) ; (* Text y-Achse *)
- FFPToStr(Pb^.B.YHinten,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 1 TO 3 DO
- Move(Pb^.Rp,Pb^.KastenX0+407-j*48,Pb^.KastenY0+243+j*48) ;
- l := Pb^.B.YHinten+ IntToFFP(j)*Pb^.B.DeltaY ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
-
- Move(Pb^.Rp,Pb^.KastenX0+407,Pb^.KastenY0+238) ; (* Text z-Achse *)
- l := Pb^.B.ZOben-4.0*Pb^.B.DeltaZ ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 3 TO 0 BY -1 DO
- Move(Pb^.Rp,Pb^.KastenX0+407,Pb^.KastenY0+3+60*j) ;
- l := Pb^.B.ZOben- IntToFFP(j)*Pb^.B.DeltaZ ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
- ELSE
-
- FOR j := 0 TO 8 DO (* Knubbel x-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0-432+j*144,Pb^.KastenY0+1152) ; (* grosse *)
- Draw(Pb^.Rp,Pb^.KastenX0-432+j*144,Pb^.KastenY0+1160) ;
- END (* FOR *) ;
- FOR j := 0 TO 7 DO
- Move(Pb^.Rp,Pb^.KastenX0-432+72+j*144,Pb^.KastenY0+1152) ; (* kleine *)
- Draw(Pb^.Rp,Pb^.KastenX0-432+72+j*144,Pb^.KastenY0+1156) ;
- END (* FOR *) ;
- FOR j := 0 TO 6 DO (* Knubbel y-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+1152-j*72,Pb^.KastenY0+720+j*72) ;(* grosse *)
- Draw(Pb^.Rp,Pb^.KastenX0+1160-j*72,Pb^.KastenY0+720+j*72) ;
- END (* FOR *) ;
- FOR j := 0 TO 5 DO (* kleine *)
- Move(Pb^.Rp,Pb^.KastenX0+1152-36-j*72,Pb^.KastenY0+720+36+j*72) ;
- Draw(Pb^.Rp,Pb^.KastenX0+1156-36-j*72,Pb^.KastenY0+720+36+j*72) ;
- END (* FOR *) ;
-
- FOR j := 0 TO 8 DO (* Knubbel z-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0+1152,Pb^.KastenY0+j*90) ; (* grosse *)
- Draw(Pb^.Rp,Pb^.KastenX0+1160,Pb^.KastenY0+j*90) ;
- END (* FOR *) ;
- FOR j := 0 TO 7 DO
- Move(Pb^.Rp,Pb^.KastenX0+1152,Pb^.KastenY0+45+j*90) ; (* kleine *)
- Draw(Pb^.Rp,Pb^.KastenX0+1156,Pb^.KastenY0+45+j*90) ;
- END (* FOR *) ;
-
-
- l := Pb^.B.XLinks ; (* Text x-Achse *)
- Move(Pb^.Rp,Pb^.KastenX0-452,Pb^.KastenY0+1180+10) ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 1 TO 8 DO
- l := Pb^.B.XLinks+ IntToFFP(j)*Pb^.B.DeltaX*0.5 ;
- Move(Pb^.Rp,Pb^.KastenX0-462+j*144,Pb^.KastenY0+1180+10) ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
- Move(Pb^.Rp,Pb^.KastenX0+1152+35,Pb^.KastenY0+733) ; (* Text y-Achse *)
- FFPToStr(Pb^.B.YHinten,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 1 TO 6 DO
- Move(Pb^.Rp,Pb^.KastenX0+1152+37-j*72,Pb^.KastenY0+720+3+j*72) ;
- l := Pb^.B.YHinten+ IntToFFP(j)*Pb^.B.DeltaY*0.5 ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
- END (* IF *) ;
-
- Move(Pb^.Rp,Pb^.KastenX0+1152+50,Pb^.KastenY0+710) ; (* Text z-Achse *)
- l := Pb^.B.ZOben-4.0*Pb^.B.DeltaZ ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
-
- FOR j := 7 TO 0 BY -1 DO
- Move(Pb^.Rp,Pb^.KastenX0+1152+50,Pb^.KastenY0+4+90*j) ;
- l := Pb^.B.ZOben- 0.5*IntToFFP(j)*Pb^.B.DeltaZ ;
- FFPToStr(l,str) ;
- Text(Pb^.Rp,ADR(str),Length(str)) ;
- END ;
-
-
- END BeschriftungZeichnen ;
-
-
-
-
- PROCEDURE ClearBitMap(VAR Pb: PlotBasePtr) ; (************************************)
-
- BEGIN
-
- SetAPen(Pb^.Screen^.firstWindow^.rPort,0) ;
-
- IF Pb^.GrosseBitmap THEN
- RectFill(Pb^.Screen^.firstWindow^.rPort,0,0,800,800) ;
- RectFill(Pb^.Screen^.firstWindow^.rPort,800,0,BitMapWidth,800) ;
-
- RectFill(Pb^.Screen^.firstWindow^.rPort,0,800,800,BitMapHeight) ;
- RectFill(Pb^.Screen^.firstWindow^.rPort,800,800,BitMapWidth,BitMapHeight) ;
- ELSE
- RectFill(Pb^.Screen^.firstWindow^.rPort,0,0,Pb^.ScreenWidth,
- Pb^.ScreenHeight) ;
- END (* IF *) ;
-
- SetAPen(Pb^.Screen^.firstWindow^.rPort,1) ;
-
- END ClearBitMap ;
-
-
-
- PROCEDURE FunktionReinSchreiben(VAR Pb: PlotBasePtr; clear: BOOLEAN) ;
-
- VAR String1,String2: ARRAY[0..10] OF CHAR ;
- String3: ARRAY[0..70] OF CHAR ;
-
- BEGIN
-
- SetAPen(Pb^.Rp,0) ; (* Hintergrundfarbe *)
-
- String1 := 'f(x,y)' ;
- String2 := '=' ;
-
-
- IF clear THEN
- IF Pb^.GrosseBitmap THEN
- RectFill(Pb^.Rp,25,30,800,40) ;
- RectFill(Pb^.Rp,800,30,BitMapWidth,40) ;
- ELSE
- RectFill(Pb^.Rp,25,10,630,20) ;
- END ;
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
- ELSE
- IF Pb^.GrosseBitmap THEN
- RectFill(Pb^.Rp,25,30,800,40) ;
- RectFill(Pb^.Rp,800,30,BitMapWidth,40) ;
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
- Move(Pb^.Rp,25,38) ;
- Text(Pb^.Rp,ADR(String1),Length(String1)) ;
- Move(Pb^.Rp,80,38) ;
- Text(Pb^.Rp,ADR(String2),Length(String2)) ;
- Move(Pb^.Rp,98,38) ;
- Text(Pb^.Rp,ADR(Pb^.Funktion),Length(Pb^.Funktion)) ;
- ELSE
- RectFill(Pb^.Rp,25,10,630,20) ;
- SetAPen(Pb^.Rp,1) ; (* Vordergrundfarbe *)
- Move(Pb^.Rp,25,18) ;
- Text(Pb^.Rp,ADR(String1),Length(String1)) ;
- Move(Pb^.Rp,80,18) ;
- Text(Pb^.Rp,ADR(String2),Length(String2)) ;
- Move(Pb^.Rp,98,18) ;
- IF Length(Pb^.Funktion) > 67 THEN
- CopyPart(String3,Pb^.Funktion,0,67) ;
- Text(Pb^.Rp,ADR(String3),Length(String3)) ;
- ELSE
- Text(Pb^.Rp,ADR(Pb^.Funktion),Length(Pb^.Funktion)) ;
- END ;
- END ;
- END ;
-
-
- END FunktionReinSchreiben ;
-
-
-
- PROCEDURE HelpFenster(VAR Pb: PlotBasePtr): BOOLEAN ;
-
-
- TYPE String = ARRAY [0..5] OF CHAR ;
- Texte = ARRAY [0..10] OF String ;
- String1 = ARRAY [0..50] OF CHAR ;
- Texte1 = ARRAY [0..5] OF String1 ;
-
- VAR Str : Texte ;
- Str1 : Texte1 ;
- i,j,x,y : INTEGER ;
- class : IntuitionD.IDCMPFlagSet ;
- IntuiMsg : POINTER TO IntuitionD.IntuiMessage ;
- Window1 : IntuitionD.NewWindow ;
- Window2Ptr: IntuitionD.WindowPtr ;
- Rp : GraphicsD.RastPortPtr ;
- code : CARDINAL ;
-
-
-
- PROCEDURE OpenWindow(): BOOLEAN ;
-
-
- VAR
- i : CARDINAL ;
-
- BEGIN
-
- WITH Window1 DO
- leftEdge := 20 ; topEdge := 40 ;
- width := 601 ; height := 451 ;
- detailPen := 0 ;
- blockPen := 1 ;
- idcmpFlags := IntuitionD.IDCMPFlagSet{IntuitionD.rawKey} ;
- flags := IntuitionD.WindowFlagSet{IntuitionD.noCareRefresh,
- IntuitionD.simpleRefresh,
- IntuitionD.borderless,
- IntuitionD.activate} ;
- firstGadget := NIL ;
- checkMark := NIL ;
- title := NIL ;
- screen := Pb^.Screen ;
- bitMap := NIL ;
- minWidth := 601 ; maxWidth := 601 ;
- minHeight := 301 ; maxHeight := 301 ;
- type := IntuitionD.ScreenFlagSet{IntuitionD.publicScreen} ;
- END (* WITH *) ;
-
- Window2Ptr := IntuitionL.OpenWindow(Window1) ;
- IF Window2Ptr = NIL THEN
- RETURN FALSE ;
- END ;
-
- Rp := Window2Ptr^.rPort ;
-
- RETURN TRUE ;
-
- END OpenWindow ;
-
-
-
- PROCEDURE DrawButton(x,y,t:INTEGER; big: BOOLEAN) ;
-
- VAR d: INTEGER ;
-
- BEGIN
-
- SetAPen(Rp,1) ; (* Vordergrundfarbe *)
-
- IF big THEN d := 30 ;
- ELSE d := 16 ;
- END ;
- Move(Rp,x+3,y+26) ;
- Draw(Rp,x,y+23) ;
- Draw(Rp,x,y+3) ;
- Draw(Rp,x+3,y) ;
- Draw(Rp,x+d+7,y) ;
- Draw(Rp,x+d+10,y+3) ;
- Draw(Rp,x+d+10,y+19) ;
- Move(Rp,x+7,y+21) ;
- Draw(Rp,x+4,y+19) ;
- Draw(Rp,x+4,y+3) ;
- Draw(Rp,x+7,y) ;
- Move(Rp,x,y+3) ;
- Draw(Rp,x+4,y+3) ;
- Move(Rp,x,y+23) ;
- Draw(Rp,x+4,y+19) ;
-
- (* Schatten *)
- Move(Rp,x+3,y+26) ; Draw(Rp,x+d+7,y+26) ;
- Move(Rp,x+4,y+25) ; Draw(Rp,x+d+8,y+25) ;
- Move(Rp,x+5,y+24) ; Draw(Rp,x+d+9,y+24) ;
- Move(Rp,x+6,y+23) ; Draw(Rp,x+d+10,y+23) ; Draw(Rp,x+d+10,y+19) ;
- Move(Rp,x+7,y+22) ; Draw(Rp,x+d+9,y+22) ; Draw(Rp,x+d+9,y+20) ;
- Move(Rp,x+7,y+21) ;
-
-
- IF t >= 0 THEN
- IF Length(Str[t]) = 2 THEN
- Move(Rp,x+14,y+14) ;
- ELSE
- Move(Rp,x+10,y+14) ;
- END ;
- Text(Rp,ADR(Str[t]),Length(Str[t])) ;
- END ;
-
- END DrawButton ;
-
-
- BEGIN (* HelpFenster *)
-
- IF NOT OpenWindow() THEN
- RETURN FALSE
- END ;
-
- SetAPen(Rp,1) ;
- SetDrMd(Rp,GraphicsD.jam1) ;
-
- Move(Rp,600,0) ; Draw(Rp,0,0) ; Draw(Rp,0,450) ;
- Move(Rp,590,10) ; Draw(Rp,190,10) ;
- Move(Rp,0,0) ; Draw(Rp,10,10) ; Draw(Rp,10,290) ;
- Move(Rp,0,300) ; Draw(Rp,10,310) ; Draw(Rp,10,440) ;
- Move(Rp,590,310) ; Draw(Rp,10,310) ;
-
-
- FOR i := 0 TO 10 DO
- Move(Rp,i,300-i) ; Draw(Rp,600-i,300-i) ; Draw(Rp,600-i,i) ;
- END ;
-
-
- FOR i := 0 TO 10 DO
- Move(Rp,i,450-i) ; Draw(Rp,600-i,450-i) ; Draw(Rp,600-i,300+i) ;
- END ;
-
-
- (* Ueberschrift *)
-
- x := 25 ; y := 0 ;
- Move(Rp,x,y+44) ; Draw(Rp,x,y) ; Draw(Rp,x+165,y) ;
- Move(Rp,x,y) ; Draw(Rp,x+7,y+7) ; Draw(Rp,x+158,y+7) ;
- Move(Rp,x+7,y+37) ; Draw(Rp,x+7,y+7) ;
-
- (* Area *)
-
- FOR i := 0 TO 7 DO
- Move(Rp,x+i,y+44-i) ; Draw(Rp,x+165-i,y+44-i) ; Draw(Rp,x+165-i,y+i) ;
- END ;
-
- (* Area END *) ;
-
- Move(Rp,x,y) ; Draw(Rp,10,10) ;
- Move(Rp,x,y+44) ; Draw(Rp,10,54) ; Draw(Rp,175,54) ; Draw(Rp,x+165,y+44) ;
-
- Move(Rp,26,44) ; Draw(Rp,189,44) ;
- Move(Rp,24,45) ; Draw(Rp,187,45) ;
- Move(Rp,23,46) ; Draw(Rp,186,46) ;
- Move(Rp,21,47) ; Draw(Rp,184,47) ;
- Move(Rp,20,48) ; Draw(Rp,183,48) ;
- Move(Rp,19,49) ; Draw(Rp,182,49) ;
- Move(Rp,17,50) ; Draw(Rp,180,50) ;
- Move(Rp,15,51) ; Draw(Rp,178,51) ;
- Move(Rp,14,52) ; Draw(Rp,177,52) ;
- Move(Rp,12,53) ; Draw(Rp,175,53) ;
- Move(Rp,11,54) ; Draw(Rp,174,54) ;
-
-
- Str1[0] := 'Tastaturbelegung' ;
- Move(Rp,x+19,y+25) ; Text(Rp,ADR(Str1[0]),Length(Str1[0])) ;
-
- Str[0] := 'ESC' ; Str[1] := 'F1' ; Str[2] := 'F2' ; Str[3] := 'F3' ;
- Str[4] := 'F4' ; Str[5] := 'F5' ; Str[6] := 'F6' ; Str[7] := 'F7' ;
- Str[8] := 'F8' ; Str[9] := 'F9' ; Str[10] := 'F10' ;
-
- Str1[0] := 'Quit' ; Str1[1] := 'Zoom in: Strecken in X,Y,Z';
- Str1[2] := 'Strecken nur in X' ; Str1[3] := 'Strecken nur in Y' ;
- Str1[4] := 'Strecken nur in Z' ; Str1[5] := '' ;
-
- DrawButton(25,60+50,0,TRUE) ;
- Move(Rp,80,78+50) ;
- Text(Rp,ADR(Str1[0]), Length(Str1[0])) ;
-
- FOR i := 0 TO 4 DO
- DrawButton(25+i*55,250-i*24,i+1,TRUE) ; Move(Rp,80+i*55,268-i*24) ;
- Text(Rp,ADR(Str1[i+1]), Length(Str1[i+1])) ;
- END ;
-
- Str1[1] := 'Zoom out: Stauchen in X,Y,Z';
- Str1[2] := 'Stauchen nur in X' ; Str1[3] := '' ;
- Str1[4] := '' ; Str1[5] := '' ;
- FOR i := 0 TO 4 DO
- DrawButton(315+i*55,120-i*24,i+6,TRUE) ; Move(Rp,370+i*55,138-i*24) ;
- Text(Rp,ADR(Str1[i+1]), Length(Str1[i+1])) ;
- END ;
-
- Str1[0] := 'Stauchen nur in Y' ;
- Move(Rp,276,88) ; Text(Rp,ADR(Str1[0]), Length(Str1[0])) ;
- Str1[0] := 'Stauchen nur in Z' ;
- Move(Rp,331,64) ; Text(Rp,ADR(Str1[0]), Length(Str1[0])) ;
- Str1[0] := 'Anfangseinstellung' ;
- Move(Rp,378,40) ; Text(Rp,ADR(Str1[0]), Length(Str1[0])) ;
-
-
- (* Kreuz, CursorTasten *)
-
- Str1[0] := 'Scrolling:' ;
- Move(Rp,40,322) ; Text(Rp,ADR(Str1[0]),Length(Str1[0])) ;
-
- x := 55 ; y := 355 ;
- Move(Rp,x+20,y+40) ; Draw(Rp,x+20,y) ;
- Move(Rp,x+18,y+2) ; Draw(Rp,x+20,y) ; Draw(Rp,x+22,y+2) ;
-
- Move(Rp,x,y+20) ; Draw(Rp,x+40,y+20) ;
- Move(Rp,x+39,y+19) ; Draw(Rp,x+40,y+20) ;Draw(Rp,x+35,y+21) ;
-
- Move(Rp,x,y+30) ; Draw(Rp,x+40,y+10) ;
- Move(Rp,x,y+29) ; Draw(Rp,x,y+30) ; Draw(Rp,x+4,y+29) ;
-
- Str[0] := 'x' ; Str[1] := 'y' ; Str[2] := 'z' ;
- Move(Rp,x+24,y+4) ; Text(Rp,ADR(Str[2]),Length(Str[0])) ;
- Move(Rp,x+42,y+24); Text(Rp,ADR(Str[0]),Length(Str[1])) ;
- Move(Rp,x+5,y+36) ; Text(Rp,ADR(Str[1]),Length(Str[2])) ;
-
- Str1[0] := 'Cursortasten' ;
- Move(Rp,155,322) ; Text(Rp,ADR(Str1[0]),Length(Str1[0])) ;
-
-
- x := 190 ; y := 335 ;
-
- Str[0] := 'Y' ; Str[1] := 'X' ;
-
- DrawButton(x,y,0,FALSE) ;
- DrawButton(x,y+60,0,FALSE) ;
- DrawButton(x-15,y+30,1,FALSE) ;
- DrawButton(x+15,y+30,1,FALSE) ;
-
-
- (* Zahlenblock *)
-
- Str1[0] := 'Zahlenblock' ;
- Move(Rp,279,322) ; Text(Rp,ADR(Str1[0]),Length(Str1[0])) ;
-
-
- Str[1] := '' ; Str[2] := 'Z' ; Str[3] := '' ;
- Str[4] := 'X' ; Str[5] := '' ; Str[6] := 'X' ;
- Str[7] := '' ; Str[8] := 'Z' ; Str[9] := '' ;
-
- x := 250 ; y := 332 ;
-
- FOR i := 0 TO 2 DO
- FOR j := 1 TO 3 DO
- DrawButton(x+j*30,y+i*30,i*3+j,FALSE) ;
- END ;
- END ;
-
-
-
- LOOP
- ExecL.WaitPort(Window2Ptr^.userPort) ;
- IntuiMsg := ExecL.GetMsg(Window2Ptr^.userPort) ;
- IF IntuiMsg # NIL THEN
- class := IntuiMsg^.class ;
- code := IntuiMsg^.code ;
- ExecL.ReplyMsg(IntuiMsg) ;
- IF (IntuitionD.rawKey IN class) THEN
- IF code = 223 THEN
- code := WelcheTaste(code) ;
- EXIT ;
- END ;
- END ;
- END (* IF *) ;
- END (* LOOP *) ;
-
- IF Window2Ptr # NIL THEN
- IntuitionL.CloseWindow(Window2Ptr) ;
- END ;
-
- RETURN TRUE ;
-
-
- END HelpFenster ;
-
-
- END PlotZeichnen.
-
-
-